from typing import List, Optional
from pydantic import BaseModel, Field


class ScoreItem(BaseModel):
    dimension_id: int = Field(..., description="评分维度ID")
    rate: float = Field(..., ge=0.5, le=5.0, description="评分（0.5-5，支持小数）")
    comment: Optional[str] = Field(None, description="评分备注（可选）")


class ScoreCreate(BaseModel):
    scores: List[ScoreItem] = Field(..., description="维度评分列表")


class ScoreResponse(BaseModel):
    code: int
    msg: str
    data: dict
